---
platform: linux
image_resource:
  type: registry-image
  source:
    repository: gcr.io/data-gpdb-public-images/gpdb6-centos7-test
    tag: latest

inputs:
- name: gpdb_src

outputs:
- name: server_tar

params:
  SERVER_SRC_RC_PREFIX:
  RC_BUILD_TYPE_GCS:

run:
  path: bash
  args:
  - -ec
  - |
    server_version="$(./gpdb_src/getversion --short)"
    echo "Creating a tarball of the source git repo"
    tar -czf "server_tar/${SERVER_SRC_RC_PREFIX}server-src-rc-${server_version}${RC_BUILD_TYPE_GCS}.tar.gz" -C gpdb_src .